package com.ruoyi.web.controller.system;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.Pool;
import com.ruoyi.system.domain.Topic;
import com.ruoyi.system.service.IPoolService;
import com.ruoyi.system.service.ITopicService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 题库管理Controller
 * 
 * @author ruoyi
 * @date 2023-01-12
 */
@Controller
@RequestMapping("/system/userpool")
public class UserPoolController extends BaseController
{
    private String prefix = "system/userpool";

    @Autowired
    private IPoolService poolService;

    @Autowired
    private ITopicService topicService;

    @RequiresPermissions("system:userpool:view")
    @GetMapping()
    public String pool()
    {
        return prefix + "/userpool";
    }

    /**
     * 查询题库管理列表
     */
    @RequiresPermissions("system:userpool:list")
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(Pool pool)
    {
        startPage();
        pool.setIsShow(Constants.IS_SHOW);
        List<Pool> list = poolService.selectUserPoolList(pool);
        return getDataTable(list);
    }


}
